#@layout()
#define script()
<script>
    /* function doChangeStatus(id, status) {
        ajaxGet("#(CPATH)/admin/user/doUserStatusChange?id=" + id + "&status=" + status)
    } */

    function doDel(id) {
        if (confirm('确定要删除吗？删除后不可恢复')) {
            ajaxGet("#(CPATH)/admin/addon/trace/del/" + id)
        }
    }

    $("#batchDel").click(function () {
        var ids = getSelectedIds();
        if (ids == "") {
            alert('您未选择任何内容');
            return
        }
        if (confirm('确定要删除吗？删除后不可恢复')) {
            ajaxGet("#(CPATH)/admin/addon/trace/delByIds?ids=" + ids)
        }
    });


    /* $(".changeRoleAction").click(function () {
        var ids = getSelectedIds();
        var roleId = $(this).attr("data-rid");
        if (ids == "") {
            alert('您未选择任何内容');
            return
        }
        ajaxGet("#(CPATH)/admin/user/doChangeRoleByIds?ids=" + ids + "&roleId=" + roleId)
    }) */


</script>
#end

#define content()
<div class="content-wrapper">

    <section class="content-header">
        <h1>
            追忆插件
            <small>Trace Plugin</small>
        </h1>
    </section>

    <section class="content">

        <div class="row">
            <div class="col-xs-12">
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <form class="form-horizontal actionPanel" action="#(CPATH)/admin/addon/trace/index" method="get">
                            <input type="hidden" name="status" value="#para('status')">
                            <div class="row">

                                <div class="form-group col-lg-4">
                                    <label class="col-sm-3 control-label">标题</label>
                                    <div class="col-sm-9">
                                        <input type="text" class="form-control" name="title" value="#para('title')">
                                    </div>
                                </div>


                                <div class="form-group col-lg-4">
                                    <div class="col-sm-12">
                                        <button type="submit" class="btn btn-primary ">查询</button>
                                        <button type="reset" class="btn btn-default">重置</button>
                                        <a class="btn"> 更多<i class="fa fa-fw fa-angle-down"></i> </a>
                                    </div>
                                </div>

                            </div>
                            <!-- /.box-body -->
                        </form>

                        <div class="row actionPanel">
                            <div class="col-xs-12">
                                <a href="#(CPATH)/admin/addon/trace/addEdit" class="btn btn-primary "> <i
                                        class="fa fa-fw fa-plus"></i> 新建</a>
                                <a href="#(CPATH)/admin/addon/trace/setting" class="btn btn-primary "> <i
                                        class="fa fa-fw fa-cog"></i> 设置</a>
                                <button type="button" id="batchDel" class="btn btn-default checkAction"> 批量删除</button>
                            </div>
                        </div>

                    </div>
                    <!-- /.box-header -->
                    <div class="box-body ">

                        <table class="table table-striped">
                            <tbody>
                            <tr>
                                <th style="width: 10px">
                                    <input name="dataItem" onchange="checkAll(this)" type="checkbox"/>
                                </th>
                                <th style="width: 10%">ID</th>
                                <th style="width: 50%">标题</th>
                                <th style="width: 40%">时间</th>
                            </tr>
							#tracePage(pageSize=15)
                            #for(tc : tracePage.list ??)
                            <tr class="jp-actiontr">
                                <td>
                                    <input class="dataItem" type="checkbox" value="#(tc.id)"/>
                                </td>
                                <td>#(tc.id)</td>
                                <td>
                                    <strong>
                                        #(tc.title)
                                    </strong>

                                    <div class="jp-actionblock">
                                        <div class="jp-actionitem">
                                            <a href="#(CPATH)/admin/addon/trace/addEdit/#(tc.id)"
                                               style="color: #006505">编辑</a> |
                                            <a href="javascript:;" onclick="doDel('#(tc.id)')"
                                               style="color: #a00">删除</a>
                                        </div>
                                    </div>
                                </td>
                                <td>
                                    #date(tc.date)
                                </td>
                            </tr>
                            #end
							#end
                            </tbody>
                        </table>
                    </div>
                    <!-- /.box-body -->
                    <div class="box-footer">
                        <div class="row">
                            <div class="col-sm-12">
                                #tracePaginate()
							    <nav aria-label="Page navigation example">
							        <ul class="pagination justify-content-center pull-right">
							            #for(page : pages)
							            <li class="page-item #(page.style)"><a class="page-link" href='#(page.url.replace("-", "?page="))'>#(page.text)</a></li>
							            #end
							        </ul>
							    </nav>
							    #end
                            </div>
                        </div>
                    </div>
                </div>
                <!-- /.box -->
            </div>
        </div>

    </section>


</div>
#end
